import service from "@/components/js/service";


export const AppFormApi = {
    getBaseUrl() {
        return "/app_form";
    },
    save(params) {
        return service.put(this.getBaseUrl(), params);
    },
    delete(params) {
        return service.delete(this.getBaseUrl(), params);
    },
    deleteById(id) {
        return service.delete(this.getBaseUrl() + "/" + id);
    },
    get(id) {
        return service.get(this.getBaseUrl() + "/" + id);
    },
    getInfo(id){
        return service.get(this.getBaseUrl() + "/getInfo/" + id);
    },
    getFormBean(id){
        return service.get(this.getBaseUrl() + "/getFormBean/" + id);
    },
    findPage(param) {
        return service.post(this.getBaseUrl() + "/pageList", param);
    },
    getAll() {
        return service.get(this.getBaseUrl() + "/all");
    },
    getByAppId(appId) {
        return service.get(this.getBaseUrl() + "/getByAppId/" + appId);
    },
    saveToDb(params) {
        return service.post(this.getBaseUrl() + "/saveToDb", params);
    },
    getNextFieldIndex(formId) {
        return service.get(this.getBaseUrl() + "/getNextFieldIndex/" + formId);
    },
    formBeanDesign(id){
        return service.get(this.getBaseUrl() + "/formBeanDesign/" + id);
    },
}
